import {customeStruct} from '../utils';
const itf = customeStruct.interface;

export const InitDataStruct = itf({
    payload: itf({
        brands: [itf(Object.assign({
            id: 'string',
            code: 'string',
            name: 'string',
        }))],
        isDealerUser: 'boolean',
        currentCompany: itf(Object.assign({
            id: 'string',
            code: 'string',
            name: 'string',
        })),
    })
});

const content = {
    id: 'string',
    partCode: 'string',
    partName: 'string',
    quantity: 'number',
};

export const List = itf({
    payload: itf({
        content: [itf(Object.assign(content))]
    })
});

export const Parts = itf({
    payload: itf({
        content: [
            itf(Object.assign({
                partId: 'string',
                partCode: 'string',
                partName: 'string',
                productCategoryCode: 'string? | null',
                minPackSize: 'number',
                minOrderQuantity: 'number',
                unit: 'string',
                usagePerCar: 'number? | null',
                status: 'number'
            }))
        ]
    })
});
